/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pruebahash;

import java.util.Enumeration;
import java.util.Hashtable;

/**
 *
 * @author avanza
 */
public class PruebaHash {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        
  /*      Hashtable<Integer,String> tabla = new Hashtable<Integer,String>();//se define <clave,elemento>
        
        //paso 1: insertar elementos en la tabla
        tabla.put(1,"pepe");
        tabla.put(2,"juan");
        tabla.put(3,"francisco");
        System.out.println(tabla.get(2));
      //paso 2: recorrer la tabla
       
        Enumeration<String> enume = tabla.elements();
        while(enume.hasMoreElements()){
            System.out.println(enume.nextElement());
        }
        */
        Hashtable<String,Persona> tabla = new Hashtable<String,Persona>();
        tabla.put("1",new Persona("david","927568925") );
        tabla.put("2",new Persona("pepe","555555") );
        tabla.put("3",new Persona("fernando","9222222925") );
        tabla.put("4",new Persona("francisco","8888888925") );
        
        
        
        Enumeration<String> enume = tabla.elements();
        while(enume.hasMoreElements()){
            System.out.println(enume.nextElement());
        
    }
}
